package com.sskj.market.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.market.bean.HotShoppingDataBean;
import com.sskj.market.ui.activity.HotCommodityActivity;
public class HotCommodityPresenter extends BasePresenter<HotCommodityActivity> {

    public void getHotShoppingData(int page,boolean flag) {
        httpService.getHotShoppingData(page)
                .tag(this)
                .execute(new JsonCallBack<HttpData<HotShoppingDataBean>>(flag?this:null) {
                    @Override
                    public void onSuccess(Response<HttpData<HotShoppingDataBean>> response) {
                        mView.getHotShoppingDataSuccess(response.body().getData());
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.getHotShoppingRefreshSuccess();
                    }
                });
    }
}
